home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / AdobeAIRInstaller.exe / setup.swf / scripts / mx / collections / XMLListCollection.as < prev   
Text File  |  2009-11-20  |  4KB  |  169 lines

  1. package mx.collections
  2. {
  3.    import mx.core.mx_internal;
  4.    
  5.    use namespace mx_internal;
  6.    
  7.    public class XMLListCollection extends ListCollectionView
  8.    {
  9.       
  10.       mx_internal static const VERSION:String = "3.0.0.0";
  11.        
  12.       
  13.       public function XMLListCollection(param1:XMLList = null)
  14.       {
  15.          super();
  16.          this.source = param1;
  17.       }
  18.       
  19.       public function child(param1:Object) : XMLList
  20.       {
  21.          var propertyName:Object = param1;
  22.          return execXMLListFunction(function(param1:Object):XMLList
  23.          {
  24.             return param1.child(propertyName);
  25.          });
  26.       }
  27.       
  28.       private function execXMLListFunction(param1:Function) : XMLList
  29.       {
  30.          var _loc2_:int = 0;
  31.          var _loc3_:XMLList = null;
  32.          var _loc4_:int = 0;
  33.          var _loc5_:Object = null;
  34.          if(!localIndex)
  35.          {
  36.             return param1(source);
  37.          }
  38.          _loc2_ = localIndex.length;
  39.          _loc3_ = new XMLList("");
  40.          _loc4_ = 0;
  41.          while(_loc4_ < _loc2_)
  42.          {
  43.             _loc5_ = localIndex[_loc4_];
  44.             _loc3_ += param1(_loc5_);
  45.             _loc4_++;
  46.          }
  47.          return _loc3_;
  48.       }
  49.       
  50.       override public function toString() : String
  51.       {
  52.          var _loc1_:* = null;
  53.          var _loc2_:int = 0;
  54.          if(!localIndex)
  55.          {
  56.             return source.toString();
  57.          }
  58.          _loc1_ = "";
  59.          _loc2_ = 0;
  60.          while(_loc2_ < localIndex.length)
  61.          {
  62.             if(_loc2_ > 0)
  63.             {
  64.                _loc1_ += "\n";
  65.             }
  66.             _loc1_ += localIndex[_loc2_].toString();
  67.             _loc2_++;
  68.          }
  69.          return _loc1_;
  70.       }
  71.       
  72.       public function text() : XMLList
  73.       {
  74.          return execXMLListFunction(function(param1:Object):XMLList
  75.          {
  76.             return param1.text();
  77.          });
  78.       }
  79.       
  80.       public function toXMLString() : String
  81.       {
  82.          var _loc1_:* = null;
  83.          var _loc2_:int = 0;
  84.          if(!localIndex)
  85.          {
  86.             return source.toXMLString();
  87.          }
  88.          _loc1_ = "";
  89.          _loc2_ = 0;
  90.          while(_loc2_ < localIndex.length)
  91.          {
  92.             if(_loc2_ > 0)
  93.             {
  94.                _loc1_ += "\n";
  95.             }
  96.             _loc1_ += localIndex[_loc2_].toXMLString();
  97.             _loc2_++;
  98.          }
  99.          return _loc1_;
  100.       }
  101.       
  102.       public function copy() : XMLList
  103.       {
  104.          return execXMLListFunction(function(param1:Object):XMLList
  105.          {
  106.             return XMLList(param1.copy());
  107.          });
  108.       }
  109.       
  110.       public function set source(param1:XMLList) : void
  111.       {
  112.          if(list)
  113.          {
  114.             XMLListAdapter(list).source = null;
  115.          }
  116.          list = new XMLListAdapter(param1);
  117.       }
  118.       
  119.       public function attributes() : XMLList
  120.       {
  121.          return execXMLListFunction(function(param1:Object):XMLList
  122.          {
  123.             return param1.attributes();
  124.          });
  125.       }
  126.       
  127.       [Bindable("listChanged")]
  128.       public function get source() : XMLList
  129.       {
  130.          return !!list ? XMLListAdapter(list).source : null;
  131.       }
  132.       
  133.       public function attribute(param1:Object) : XMLList
  134.       {
  135.          var attributeName:Object = param1;
  136.          return execXMLListFunction(function(param1:Object):XMLList
  137.          {
  138.             return param1.attribute(attributeName);
  139.          });
  140.       }
  141.       
  142.       public function descendants(param1:Object = "*") : XMLList
  143.       {
  144.          var name:Object = param1;
  145.          return execXMLListFunction(function(param1:Object):XMLList
  146.          {
  147.             return param1.descendants(name);
  148.          });
  149.       }
  150.       
  151.       public function elements(param1:String = "*") : XMLList
  152.       {
  153.          var name:String = param1;
  154.          return execXMLListFunction(function(param1:Object):XMLList
  155.          {
  156.             return param1.elements(name);
  157.          });
  158.       }
  159.       
  160.       public function children() : XMLList
  161.       {
  162.          return execXMLListFunction(function(param1:Object):XMLList
  163.          {
  164.             return param1.children();
  165.          });
  166.       }
  167.    }
  168. }
  169.